package com.homework.test3;

public class Demo2 {


    public static void main(String[] args) {
        float[] arr = {1.5f,2.5f,3.5f};
        double avg = getAvg(arr);
        System.out.println("avg = " + avg);
    }

    private static double getAvg(float[] arr) {
        double sum = 0.0;
        for (float v : arr) {
            sum+=v;
        }
        double avg = sum/ arr.length;
        return avg;
    }
}
